import Vue from 'vue';
import Router from 'vue-router';
import Home from '../components/home/index.vue';
import Book from '../components/book/index.vue';
import Center from '../components/center/index.vue';
import Search from '../components/Search/index.vue';
import Sort from '../components/sort/index.vue';
import Mview from '../components/home/mview.vue';
import BookDetial from '../components/bookdetial/index.vue';

Vue.use(Router);

export default new Router({
	routes: [
		{
			path: '/',
			redirect: '/home',
		},
		{
			path: '/home',
			component: Home,
			children: [
				{
					path: '/',
					name: 'mview',
					component: Mview//resolve => require(['../components/home/mview.vue'],resolve),
				}
			]
		},
		{
			path: '/book',
			name: 'book',
			component: Book
		},
		{
			path: '/bookdetial',
			name: 'bookdetial',
			component: BookDetial
		},
		{
			path: '/center',
			name: 'center',
			component: Center
		},
		{
			path: '/search',
			name: 'search',
			component: Search
		},
		{
			path: '/sort',
			name: 'sort',
			component: Sort
		},
		{
			path: '/bookList',
			name: 'bookList',
			component: resolve => require(['../components/public/bookList.vue'],resolve),
		},
		{
			path: '/read',
			name: 'read',
			component: resolve => require(['../components/read/index.vue'],resolve),
		}
	]
})